<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.3.1.min.js"></script>
<html>
  <head>
    <title>JSP - Hello World</title>
  </head>
  <body>
      <a href="javascript:void(0)" id="textException">访问后台controller</a>
      <br>
  </body>
    <script>
        $(function(){
            $("#textException").click(function(){
                //console.log('11111111111111111');
                $.ajax({
                    contentType: "application/json",
                    type: 'POST',
                    url: 'save',
                    data: '{"name": "lilei","age": "11"}',
                    dataType:"text",
                    success: function(data){
                        alert(data)
                    }
                })
            })
        })
    </script>
</html>